package com.me.batm.views;

import com.badlogic.gdx.math.Vector2;
import com.me.batm.models.LivingGameObject;

public class BloodParticle {
	public static final float DURATION = 0.1f;
	public static float SIZE = 1.2f;
	public static float SPEED = 100f;
	public float alpha;
	public Vector2 position, direction;
	
	public BloodParticle(float x, float y, Vector2 dir) {
		alpha = 1f;
		position = new Vector2(x, y);
		direction = dir;
	}
	
	public boolean isAlive(){
		return alpha > 0f;
	}
	
	public void update(float delta) {
		alpha -= delta * (2f - DURATION);
		position.add(direction.mul( delta*SPEED ) );
	}
}
